package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.po.Category;
import com.zhijian.warehouse.manage.entity.vo.request.CategorySearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.CategoryVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface CategoryMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Category record);

    int insertSelective(Category record);

    Category selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);

    /**
     * 查询总数
     *
     * @param categorySearchVo
     * @return
     */
    int count(CategorySearchVo categorySearchVo);

    /**
     * 查询列表
     *
     * @param categorySearchVo
     * @return
     */
    List<CategoryVo> selectList(CategorySearchVo categorySearchVo);

    /**
     * 查询单个
     *
     * @param categorySearchVo
     * @return
     */
    CategoryVo selectOne(CategorySearchVo categorySearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    CategoryVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param categorySearchVo
     * @return
     */
    void deleteByCondition(CategorySearchVo categorySearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<Category> entities);

    /**
     * 根据ParentId查询列表
     *
     * @param parentId
     * @return
     */
    List<CategoryVo> selectListByParentId(Long parentId);

    /**
     * 根据UnitId查询列表
     *
     * @param unitId
     * @return
     */
    List<CategoryVo> selectListByUnitId(Long unitId);

    /**
     * 根据WarehouseId查询列表
     *
     * @param warehouseId
     * @return
     */
    List<CategoryVo> selectListByWarehouseId(Long warehouseId);

    /**
     * 根据CreateUserId查询列表
     *
     * @param createUserId
     * @return
     */
    List<CategoryVo> selectListByCreateUserId(Long createUserId);

    /**
     * 根据UpdateUserId查询列表
     *
     * @param updateUserId
     * @return
     */
    List<CategoryVo> selectListByUpdateUserId(Long updateUserId);
}